import request from '@/utils/request'

// 查询查验记录列表
export function listCheckRecords(query) {
  return request({
    url: '/system/check/list',
    method: 'GET',
    params: query
  })
}

// 查询查验详细
export function getCheckRecord(checkId) {
  return request({
    url: '/system/check/' + checkId,
    method: 'GET'
  })
}

// 获取查验统计
export function getCheckStatistics() {
  return request({
    url: '/system/check/statistics',
    method: 'GET'
  })
}

// 扫码查验
export function scanCheck(qrCode) {
  return request({
    url: '/system/check/scan',
    method: 'POST',
    data: { qrCode }
  })
}

// 提交查验结果
export function submitCheck(data) {
  return request({
    url: '/system/check/submit',
    method: 'POST',
    data: data
  })
}

// 提交抽检结果
export function submitInspection(data) {
  return request({
    url: '/system/check/inspection',
    method: 'POST',
    data: data
  })
}

// 导出查验记录
export function exportCheckRecords(query) {
  return request({
    url: '/system/check/export',
    method: 'GET',
    params: query
  })
}